﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace FictionsDownload.DAL
{
    public interface IDAL: IDisposable
    {
        /// <summary>
        /// 保存操作
        /// </summary>
        /// <returns></returns>
        int SaveChanges();
        /// <summary>
        /// 无缓存无条件查询
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        IQueryable<T> All<T>() where T : class;
        IQueryable<T> Set<T>() where T : class;
        void Insert<T>(T entity) where T : class;
        void Update<T>(T entity) where T : class;
        void Delete<T>(T entity) where T : class;
        void Delete<T>(Expression<Func<T, bool>> conditions) where T : class;
        T Find<T>(object Id) where T : class;
        List<T> SqlQuery<T>(string sql);
        int ExecuteSqlCommand(string sql);
        long GetNextSequenceValue(string sequenceName);
    }
}
